import request from '@/utils/request'

// 查询学生列表
export function listStudent(query) {
  return request({
    url: '/student/student/list',
    method: 'get',
    params: query
  })
}

// 查询正式学员
export function getFormalStu(queryParams) {
  return request({
    url: '/student/formalStu/' + queryParams.pageNum + '/' + queryParams.pageSize,
    params: {
      schoolId: queryParams.schoolId,
      userId: queryParams.userId,
      studentName: queryParams.studentName,
      studentPhone: queryParams.studentPhone
    },
    method: 'get'
  })
}

// 查询意向学员
export function getIntentionStu(queryParams) {
  return request({
    url: '/student/intentionStu/' + queryParams.pageNum + '/' + queryParams.pageSize,
    params: {
      schoolId: queryParams.schoolId,
      userId: queryParams.userId,
      studentName: queryParams.studentName,
      studentPhone: queryParams.studentPhone
    },
    method: 'get'
  })
}

// 查询快到期学员
export function getRemindStu(queryParams) {
  return request({
    url: '/student/remindStu/' + queryParams.pageNum + '/' + queryParams.pageSize,
    params: {
      schoolId: queryParams.schoolId,
      timeNum: queryParams.timeNum,
      clsHourNum: queryParams.clsHourNum,
    },
    method: 'get'
  })
}

// 查询绑定顾问有问题的学员
export function getAdviserError(queryParams) {
  return request({
    url: '/student/bindAdviserError/' + queryParams.pageNum + '/' + queryParams.pageSize,
    params: {
      schoolId: queryParams.schoolId,
      timeNum: queryParams.studentName,
      clsHourNum: queryParams.studentPhone
    },
    method: 'get'
  })
}

/*更改绑定课程顾问*/
export function editAdviserByStudentId(ids){
  return request({
    url: '/student/editAdviser',
    data:ids,
    method:'post'
  })
}

// 查询学生详细
export function getStudent(studentId) {
  return request({
    url: '/student/student/' + studentId,
    method: 'get'
  })
}


// 新增学生
export function addStudent(data) {
  return request({
    url: '/student/student',
    method: 'post',
    data: data
  })
}

// 修改学生
export function updateStudent(data) {
  return request({
    url: '/student/student',
    method: 'put',
    data: data
  })
}

// 删除学生
export function delStudent(studentId) {
  return request({
    url: '/student/student/' + studentId,
    method: 'delete'
  })
}

// 导出学生
export function exportStudent(query) {
  return request({
    url: '/student/student/export',
    method: 'get',
    params: query
  })
}

// 查询所有校区列表(用于下拉列表)
export function getListSchool() {
  return request({
    url: '/school/school/listSchoolAll',
    method: 'get'
  })
}
// 获取所有课程顾问
export function getAdviser() {
  return request({
    url: '/student/Adviser/listAdviser/',
    method: 'get'
  })
}
